import request from '@/config/axios'

// 课程讲师 VO
export interface TeacherVO {
  id: number // id
  type: number // 讲师类型
  name: string // 姓名
  phone: string // 手机
  avatar: string // 头像
  sex: number // 性别
  introduce: string // 介绍
}

// 课程讲师 API
export const TeacherApi = {
  // 查询课程讲师分页
  getTeacherPage: async (params: any) => {
    return await request.get({ url: `/lession/teacher/page`, params })
  },

  // 查询课程讲师详情
  getTeacher: async (id: number) => {
    return await request.get({ url: `/lession/teacher/get?id=` + id })
  },

  // 新增课程讲师
  createTeacher: async (data: TeacherVO) => {
    return await request.post({ url: `/lession/teacher/create`, data })
  },

  // 修改课程讲师
  updateTeacher: async (data: TeacherVO) => {
    return await request.put({ url: `/lession/teacher/update`, data })
  },

  // 删除课程讲师
  deleteTeacher: async (id: number) => {
    return await request.delete({ url: `/lession/teacher/delete?id=` + id })
  },

  // 导出课程讲师 Excel
  exportTeacher: async (params) => {
    return await request.download({ url: `/lession/teacher/export-excel`, params })
  },
}